<extend name="Index/index" />
<block name="main">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title></title>
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/home_public/css/dotamax_style_2016051401.css" />
  <link href="__PUBLIC__/home_public/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/home_public/css/popModal.css" />
  <link rel="stylesheet" href="__PUBLIC__/home_public/css/video.css">
  <style>
    #comment p{
      display: blcok; 
    }
  </style>
 </head>
 <body>
   <div class="main-shadow-box">
    <div class="main-container" style="margin-top:0px;margin-bottom:1px;padding-bottom:1px;">
     <div class="container xuning-box" style="margin:40px auto;">
      <div style="font-size: 18px;line-height: 10px;text-align: center;margin-bottom: 30px;">
       <{$title}>
      </div>
      <div style="margin-left:90px;position: relative;">
       <div style="width:65px;height:41px;right:70px;
          bottom:5px;background-color: transparent;position: absolute;margin-top:520px;text-align: center;margin-left:75px;line-height: 30px;color: transparent"></div>
    <embed src="<{$src}>" 
 quality="high" width= 1300 height="600" align="center" allowScriptAccess="always" allowFullScreen="true" mode="transparent" type="application/x-shockwave-flash">
    </embed>
      <input type="hidden" id="vid" value="<{$vid}>">
      <input type="hidden" id="uid" value="<{$uid}>">
      <input type="hidden" id="name" value="<{$name}>">


      <div id="comment-container" style="position: relative; margin-left: 250px; ">
      <h3>评论区</h3>
      <volist name="list" id="c">
      <div id="comment" style="background-color:#282B2F; float: left;width: 680px; margin-top: 5px;margin-bottom: 5px;">
        <span style="color: blue"><{$c.sender}>:</span>
        <p style="display: block;margin-left: 50px;"><{$c.comment}></p>
        <span style="margin-left: 550px;color: grey"><{$c.sendTime}></span>
      </div>
      </volist>

      </div>
      <div style="position:relative; float: left;margin-left: 250px;" >
      <textarea id="txt" style="float:left;" autofocus="" cols="100" rows="10"></textarea>
      <button id='send' class="btn btn-default" style="position: absolute;left:0;top:153px;width: 70px;height: 30px">发表</button>
      </div>
     </div>
    </div>
   </div>
  </div>
  <script type="text/javascript">
    $('#send').click(function(){
      var txt = $('#txt').val();
      var vid = $('#vid').val();
      var uid = $('#uid').val();
      var sender = $('#name').val();
      if(uid == null){
        alert('请登录后留言');
        return false;
      }else{
        alert(uid);
      }
      // alert(sender);
      $.ajax({
                type:'post',
                url:"<{:U('Home/Video/comment')}>",
                data:{'comment':txt,'v_id':vid,'u_id':uid,'sender':sender},
                success:function(data){
                  if(data){
                    alert('发送成功');
                     $('#comment-container').append(data);
                     $('#txt').val('');
                  }else{
                    alert('发送失败');
                    return false;
                  }
                }
    })
})
    
  </script>
 </body>
</html>
</block>